package com.jone.phone.detail.model;

import android.net.Uri;
import android.provider.BaseColumns;

public class DayStat implements BaseColumns{
	
	public static final Uri URI_DAY_STAT = Uri.parse("content://com.jone.phone.detail/day_stat");
	public static final String CONTENT_TYPE = "com.jone.phone.detail/day_stat";
	
	public static final String DAY = "s_day";
	public static final String KEY = "s_key";
	public static final String NUM = "s_num";
	
	private String day;
	private String key;
	private Integer num = 0;
	
	public DayStat(){
		
	}
	
	public DayStat(String day,String key,int duration){
		this.day = day;
		this.key = key;
		this.num = duration;
	}
	
	public void addNum(int duration){
		this.num +=duration;
	}
	
	public String getDay() {
		return day;
	}
	public void setDay(String day) {
		this.day = day;
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}	
	
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((day == null) ? 0 : day.hashCode());
		result = prime * result + ((key == null) ? 0 : key.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DayStat other = (DayStat) obj;
		if (day == null) {
			if (other.day != null)
				return false;
		} else if (!day.equals(other.day))
			return false;
		if (key == null) {
			if (other.key != null)
				return false;
		} else if (!key.equals(other.key))
			return false;
		return true;
	}
	

}
